package watchTracker;

public class core {
	
	private static watchGUI gui;
	private static dbManager dbm;
	private static fileWalker fwalk;
	private String filePath;
	
	public core(String path){
		gui = new watchGUI(this);
		dbm = new dbManager(this);
		fwalk = new fileWalker(this);
		this.filePath=path;
	}
	
	public void start(){
		gui.reset();
		dbm.readDataBase();
		fwalk.watchShowPath(filePath);
	}
	
	
	//to GUI passing functions

	public void addFileGUI(String name){
		gui.addFile(name);
	}
	public void setSeason(int seasonNumb){
		gui.setSeason(seasonNumb);
	}
	public void setEpisode(int episodeNumb){
		gui.setEpisode(episodeNumb);
	}
	public void setEpisodeTitle (String title){
		gui.setEpisodeTitle(title);
	}
	public void setShowName(String showName){
		gui.setShowName(showName);
	}
	public void addShowNameGUI(String showName){
		gui.addShowName(showName);
	}
	public void addGenreGUI (String genre){
		gui.addGenre(genre);
	}
	public void setSelectedFileGUI(int index){
		gui.setSelectedFile(index);
	}
	public void setFilePathGUI(String pathName) {
		gui.diplayFilePath(pathName);	
	}
	
	//to DB passing functions
	public void addGenreDB(String genre){
		dbm.addGenre(genre);
	}
	public void addShowDB(String name, String genre){
		dbm.addShow(name, genre);
	}
	public void addEpisodeDB(String showname, String title, int seasonNumb, int episodeNumb, int quality, int rating, String summary, String fileName){
		dbm.addEpisode(showname, title, seasonNumb, episodeNumb, quality, rating, summary, fileName);
	}
	
	// to FW passing functions
	public void watchShow(String fileName){
		gui.reset();
		fwalk.watchShowName(fileName);
	}


}
